var pagetop = document.body.scrollHeight;
var pageleft = document.body.scrollWidth;
var datesetT = pagetop/2-100;
var datesetL = pageleft/2-100;
pageleft-=350;
pagetop +=200;
var newElementaudio;
var dayZoneSet = document.getElementById("setdate");
dayZoneSet.style.cssText ="text-align:center;position:absolute;padding:10px;width:"+pageleft+"px;height:"+pagetop+"px;border:1px white solid;background:;";
function changedisplay(ob){
	var attr = ob.value;
	if(attr !="隐藏"){
	ob.value="隐藏";
	dayZoneSet.style.cssText ="text-align:center;position:absolute;padding:10px;width:"+pageleft+"px;height:"+pagetop+"px;border:1px black solid;background:;";
	}
	else{
	ob.value="显示时间";
	var x = pageleft-350;
	var y = -pagetop+580;
	dayZoneSet.style.cssText="text-align:center;position:absolute;overflow:hidden;left:"+x+"px;top:"+y+"px;width:68px;height:26px;";
	}
}


setInterval("askservertime()",1000);
//askservertime()
function askservertime(){
xmlHttp = createAjaxClass();
xmlHttp.open("post","daojishi.php",true);
xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
//xmlHttp.onreadystatechange =null;
xmlHttp.onreadystatechange = updatetime;
xmlHttp.send(null);
}
function updatetime(){
	if(xmlHttp.readyState == 4 && xmlHttp.status == 200){
	   var xml = xmlHttp.responseXML.documentElement;
	   var term =xml.childNodes;
	   var lday = term[0].firstChild.nodeValue;
	   var lhour = term[1].firstChild.nodeValue;
	   var lminute = term[2].firstChild.nodeValue;
	   var lsecond = term[3].firstChild.nodeValue;
	   var ltoday = term[4].firstChild.nodeValue;
	   var targetDate = term[5].firstChild.nodeValue;
	   var dayE = document.getElementById("jishiDay");
	   var todayE = document.getElementById("today");
	   var messeges = "距离<span class='targetdate'>"+targetDate+"</span>还有<br /><span class ='daojishistyle'>"+lday+"</span>天<span class ='daojishistyle'>"+lhour+"</span>小时<span class ='daojishistyle'>"+lminute+"</span>分<span class ='daojishistyle'>"+lsecond+"</span>秒";
	   var todaytimemes ="现在时间：<span class ='daojishistyle2'>"+ltoday+"</span>";
	   dayE.innerHTML =messeges;
	   todayE.innerHTML =todaytimemes;
	   if(lsecond==0&&lminute==0){
		newElementaudio = document.createElement("div");
		var audioStr = "<embed src='style/onehourpassed.mp3' autostart='true' loop='false' hidden='true' volume='100'>"+"</embed>";
		newElementaudio.innerHTML=audioStr;
		dayZoneSet.appendChild(newElementaudio);
		setTimeout("dayZoneSet.removeChild(newElementaudio)",10000);
	  }
	}
}
